package owlapps2012.owlToSql.events.medicalEvents;

import owlapps2012.owlToSql.base.DomainClassMapping;
import owlapps2012.owlToSql.base.DefaultAppConfig;
import owlapps2012.owlToSql.base.DomainPropertyMapping;

public class MedicalEventAppConfig extends DefaultAppConfig
{

	public MedicalEventAppConfig() throws Exception 
	{
		super();
	}

	@Override
	protected void initConf() throws Exception 
	{
		this.addDomainPropertyMapping(new DomainPropertyMapping("medical_procedure_ICD9_code", "{Q}.ICD9 = '{VALUE}'", "OWL_ICD9"));
		this.addDomainPropertyMapping(new DomainPropertyMapping("indicated_ICD10_code", "{Q}.ICD10 = '{VALUE}'", "OWL_ICD10"));
		this.addDomainPropertyMapping(new DomainPropertyMapping("issued_drug_ATC_code", "{Q}.ATC = '{VALUE}'", "OWL_LEKI"));
		this.addDomainPropertyMapping(new DomainPropertyMapping("issued_drug_BLOZ_code", "{Q}.BLOZ = '{VALUE}'", "OWL_LEKI"));
		this.addDomainPropertyMapping(new DomainPropertyMapping("issued_drug_EAN_code", "{Q}.EAN = '{VALUE}'", "OWL_LEKI"));
		this.addDomainPropertyMapping(new DomainPropertyMapping("issued_drug_ATC", "{Q}.ATC = '{VALUE}'", "OWL_LEKI"));

		
		this.addDomainClassMapping(new DomainClassMapping("Drug_issuance", "OWL_LEKI"));
		this.addDomainClassMapping(new DomainClassMapping("Medical_procedure", "OWL_ICD9"));
		this.addDomainClassMapping(new DomainClassMapping("Diagnosis_indication", "OWL_ICD10"));
		
	}

	@Override
	public String getAdditionalCondition(String name) {
		if(name.endsWith("patient"))
			return "PATIENT_ID";
		else
			return null;
	}

}
